package day21_28.day22;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main01 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Scanner scn = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        String numStr;
        while (scn.hasNext()){
            int n = scn.nextInt();
            int a = scn.nextInt();
            int[] num = new int[n];
            for (int i = 0; i < num.length; ++i) {
                num[i] = scn.nextInt();
            }
            for (int i = 0; i < num.length; i++) {
                if (a <= num[i]){
                    a = a + pvc(a , num[i]);
                }else {
                    a = a + num[i];
                }
            }
            System.out.println(a);
        }

    }
    public static int pvc(int a , int b){
        if (b == 0){
            return a;
        }
        return pvc(b , a % b);
    }
}
